package guice.boot.archive.spi.service.event;

import guice.boot.archive.spi.event.Event;


public interface EventService {

    /**
     * Initiate synchronous delivery of an event. This method does not return to
     * the caller until delivery of the event is completed.
     *
     * @param event The event to send to all listeners which subscribe to the
     *              topic of the event.
     */
    void sendEvent(Event event);

    /**
     * Register an event handler
     *
     * @param eventHandler
     */
    void register(EventHandler eventHandler);

    /**
     * un-register an event handler
     *
     * @param eventHandler
     */
    void unRegister(EventHandler eventHandler);

    /**
     * un-register event handler whose classLoader matches the specified param.
     *
     * @param classLoader
     */
    void unRegister(ClassLoader classLoader);

}